import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    Authorization: localStorage.getItem('loginUser') ? localStorage.getItem('loginUser') : ''
  },
  getters: {
    
  },
  mutations: {
    //注册处理函数，在login组件的login方法上使用this.$store.commit('login',data);
    login(state, user) {
      state.Authorization = user;
      localStorage.setItem('loginUser', user)
    },
  },
  actions: {
  },
  modules: {
  }
})
